package com.yulei.framework.ioc.utils;

/**
 * @author yulei
 * date 2023/11/21 17:43
 *
 * 负责处理Java类的加载
 */
public class ClassUtils {

    public static ClassLoader getDefaultClassLoader() {
        return Thread.currentThread().getContextClassLoader();
    }

    // 通过 className 参数获取对象的Class
    public static Class loadClass(String className) {
        try {
            return getDefaultClassLoader().loadClass(className);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}
